package com.zhenai.rocyuan.util;

import java.util.Map;

import org.apache.commons.codec.binary.Base64;

public class CodeUtil {

	 /** 
     * RSA算法测试用例 
     * @author Administrator 
     * 
     */  
   
        //公钥  
        private static byte[] publicKey;  
        //私钥  
        private static byte[] privateKey;  
        
        
        public static void initKey() throws Exception  
        {  
            //初始化密钥  
            Map<String,Object> keyMap=RSACoder.initKey();  
            publicKey=RSACoder.getPublicKey(keyMap);  
            privateKey=RSACoder.getPrivateKey(keyMap);  
            System.out.println("公钥:"+Base64.encodeBase64(publicKey));  
            System.out.println("私钥:"+Base64.encodeBase64(privateKey));  
        }  
}
